package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.query.ClientQueryObject;
import cn.wolfcode.crm.service.IClientService;
import cn.wolfcode.crm.util.PageResult;
import cn.wolfcode.crm.util.PermissionName;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: crm
 * @description:
 * @author: Mr.chen
 * @create: 2018-07-07 22:06
 **/
@Controller
@RequestMapping("clientresources")
public class ClientResourcesController {
    @Autowired
    private IClientService service;

    @RequestMapping("")
    @PermissionName("客户资源池主页")
    @RequiresPermissions("clientresources:index")
    public String index() {
        return "clientresources/list";
    }

    @RequestMapping("list")
    @ResponseBody
    @RequiresPermissions("clientresources:list")
    @PermissionName("客户资源池数据")
    public PageResult list(ClientQueryObject qo) {
        qo.setState1(3);
        PageResult result = service.query(qo);
        return result;
    }
}
